<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active{
            color: #999999;
            border: 1px solid red;
            width: 100px;
            height: 100px;
        }
        .error{
            background-color: orange;
        }
        [v-cloak] {
            display: none;
        }
    </style>
</head>
<body>
    <h2>Vue样式绑定href</h2>
        <div id="app">
           <div v-bind:class="[activeClass,errorClass]">测试样式</div>
           <button v-on:click="handle">切换</button>

           <p style="color: #666666;">
               在右侧控制台输入 vm.msg='xxxxx'回车 视图会变 实现双向数据绑定
           </p>
        </div>
</body>
<script src="./js/vue.js"></script>
<script>
    /*
        总结：
                操作类名 直接修改对应的值
                对象形式是通过true和false显示与否
    */
    var vm = new Vue({
        el: '#app',
        data: {
            activeClass: 'active',
            errorClass:  'error'
        },
        methods:{
            handle:function(){
                //控制 isActive样式的切换
                this.activeClass = ''
            }
        }
    })
</script>
</html>